--- import type { GetStaticPaths, InferGetStaticPropsType } from "astro"; import { getCollection } from "astro:content"; import Layout from "../layouts/BaseLayout.astro"; import Pagination from "../components/Pagination.astro"; import PostSummary from "../components/PostSummary.astro"; type Props = InferGetStaticPropsType<typeof getStaticPaths>; export const getStaticPaths = (async ({ paginate }) => { const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; }); posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); return paginate(posts, { pageSize: 10, }); }) satisfies GetStaticPaths; const { page } = Astro.props; --- <Layout> <section style={{ "margin-top": "3rem" }}> {page.data.map((post) => <PostSummary post={post} />)} </section> <section> <Pagination nextUrl={page.url.next} prevUrl={page.url.prev} /> </section> </Layout>